package com.mytools.common.example.schedule;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author LJK
 * @description
 * @date 2025/2/8
 */
public class Main {
    public static void main(String[] args) {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss SSS");
        ScheduleService scheduleService = new ScheduleService();
        scheduleService.schedule(() -> {
            System.out.println("当前任务1执行时间为"+ LocalDateTime.now().format(formatter));
        }, 1000);

        scheduleService.schedule(()->{
            System.out.println("当前任务2执行时间为"+ LocalDateTime.now().format(formatter));
        },5000);
    }
}
